from kashgari.tasks.classification import CNNModel
from kashgari.corpus import SMP2018ECDTCorpus
from kashgari.utils import load_model
train_x,train_y = SMP2018ECDTCorpus.load_data('train')
valid_x,valid_y = SMP2018ECDTCorpus.load_data('valid')
test_x,test_y = SMP2018ECDTCorpus.load_data("test")

import logging
logging.basicConfig(level=logging.DEBUG)

model = CNNModel()
model.fit(train_x,train_y,valid_x,valid_y)

model.save('saved_classification_model')

loaded_model = load_model('saved_classification_model')
loaded_model.predict(test_x[:10])

loaded_model.compile_model()
